import {toast} from "../../../utils/tool";
import {APP_NAME} from "../../../constant/index";

const app = getApp()
Component({
    properties: {
        visible: {
            type: Boolean,
            value: false,
        },
        shareId: {
            type: String,
        }
    },
    data: {
        appName: APP_NAME,
    },
    methods: {
        confirmHandler() {
            const {shareId} = this.data
            this.triggerEvent('confirm', false)
            if (!shareId.length) return toast({title: "没有邀请人"})
            app.ajax({
                url: "/api/user/yaoqinguser",
                data: {yaoqing_user_id: shareId},
                success: resp => {
                    const {code, msg} = resp
                    toast({title: msg, time: 2000})
                }
            })
        },
    }
});
